package com.yuneec.droneservice.request;

/**
 * Created by zd.zhang on 2017/9/11.
 */

public class OnRequestListener<T extends IResponse> {
    protected long sendTimeStamp;

    /**
     * Called when command execute success.
     *
     * @param response the response of command.
     */
    public void onSuccess(T response) {
    }

    /**
     * Called when command execute timeout. the default value of timeout is 2 second.
     */
    public void onTimeout() {
    }

    /**
     * Occur some errors when command execute.
     *
     * @param errorCode The reason of error.
     */
    public void onError(int errorCode) {
    }

    public long getTimeout() {
        return 20000;
    }
}
